package com.yunji.coupon.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author : peter-zhu
 * @date : 2024/10/22 19:33
 * @description : TODO
 **/
@Data
public class CouponTmplCreateDTO {

    @ApiModelProperty(value = "优惠券模板id(修改必须传)", required = true, example = "couponTmplId")
    private Long couponTmplId;

    @NotBlank(message = "优惠券名称不能为空")
    @ApiModelProperty(value = "优惠券名称", required = true, example = "couponName")
    private String couponName;

    @NotNull(message = "发放总量不能为空")
    @Max(value = 999999, message = "发放总量不能大于999999")
    @ApiModelProperty(value = "发放总量", required = true, example = "500")
    private Integer issueCount;

    @Max(value = 2)
    @Min(value = 1)
    @ApiModelProperty(value = "优惠券类型 1 平台优惠券 2 新用户优惠券", required = true, example = "1")
    private Integer couponType;

    @NotNull(message = "活动开始时间不能为空")
    @ApiModelProperty(value = "活动开始时间", required = true, example = "2024-10-01 00:00:01")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date receiveTimeS;

    @NotNull(message = "活动结束时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "活动结束时间", required = true, example = "2024-10-30 00:00:01")
    private Date receiveTimeE;

    @NotNull(message = "用券时间类型不能为空")
    @Max(value = 2)
    @Min(value = 1)
    @ApiModelProperty(value = "用券时间类型：1:固定类型 2:领取当日起", required = true, example = "1")
    private Integer validTimeType;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("用券开始时间")
    private Date validPeriodS;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("用券结束时间")
    private Date validPeriodE;
    @ApiModelProperty("几天内可用")
    private Integer validDays;

    @NotNull(message = "折扣类型不能为空")
    @Max(value = 2)
    @Min(value = 1)
    @ApiModelProperty(value = "折扣类型 1:立减 2:折扣", required = true, example = "1")
    private Integer discountType;

    @NotNull(message = "折扣值不能为空")
    @ApiModelProperty(value = "折扣值", example = "9")
    private BigDecimal discountValue;

    @NotNull(message = "领取规则不能为空")
    @Max(value = 3)
    @Min(value = 2)
    @ApiModelProperty(value = "领取规则 1 不限 2 每人限领 3 每人每天限领", required = true, example = "2")
    private Integer receiveRuleType;

    @ApiModelProperty(value = "限领多少个")
    private Integer everyReceiveCount;

    @NotNull(message = "推送类型不能为空")
    @Max(value = 2)
    @Min(value = 1)
    @ApiModelProperty(value = "推送类型:1 系统弹窗 2 下单触发", required = true, example = "1")
    private Integer triggerType;

    @ApiModelProperty(value = "优惠券推送弹窗(数组)", required = true, example = "[a,b,c]")
    private List<String> triggerDicList;

    @NotNull(message = "优惠券说明不能为空")
    @ApiModelProperty(value = "优惠券说明", required = true, example = "我说明个锤子哦")
    private String explanation;

    @Max(value = 3)
    @Min(value = 1)
    @NotNull(message = "网点范围类型为空")
    @ApiModelProperty(value = "1 所有网点权限 2 指定网点权限 3 排除网点权限", required = true, example = "1")
    private Integer siteScopeType;

    @ApiModelProperty(value = "所选网点列表")
    private List<CouponSiteDTO> couponSiteList;

//    @ApiModelProperty(value = "排除网点列表 排除网点权限的时候有值")
//    private List<CouponSiteDTO> excludeSiteList;
}
